<?php echo $this->css('css/events.css'); ?>

<div class="cms-content-pane">
    <div class="category-pane">
        <div class="pane-header"> Event Categories
            <div style="width: 50px; position: absolute; right: 10px; top: 2px; text-align:right; "> 
            	<a id="add-cat-link" href="#" title="Add Category" ><img src="images/icons/add.png" width="16" height="16" alt="add" align="absmiddle" border="0" /></a> 
                <a id="del-cat-link" href="<?php echo $this->url(array('action' => 'deleteCategory')); ?>" title="Delete Selected Category"><img src="images/icons/delete.png" width="16" height="16" alt="add" align="absmiddle" border="0" /></a> 
            </div>
        </div>
        <div class="pane-content">
            <ul class="category-list">
                <?php
													
					//$categories = $events->getEventCategories($siteid);

					for($i = 0; $i < count($categories); $i++) {
						$cat_id = $categories[$i]->getId();
						$cat = $categories[$i]->getCategoryName();
						$desc = $categories[$i]->getCategoryDescription(); 
						echo "<li><a id='$cat_id' href='#' title='$desc' >$cat</a></li>";
					}
				?>
            </ul>
        </div>
    </div>
    <div class="articles-pane">
        <div class="pane-header"> Upcoming Events In </div>
        <div class="pane-sub-header"> 
        	<a href="<?php echo $this->url(array('action' => 'add')); ?>"><img src="images/icons/newspaper_add.png" alt="add" width="16" height="16" border="0" align="absmiddle" /> New Event </a> 
            <a href="<?php echo $this->url(array('action' => 'deleteEvents')); ?>" id="delete-all-link"  ><img src="images/icons/newspaper_delete.png" alt="del" width="16" height="16" border="0" align="absmiddle" /> Delete Selected</a> 
        </div>
        <div id="event-content" class="pane-content"> Loading Page. Please Wait... </div>
        <div class="pane-footer"> Pages: </div>
    </div>
    <div id="catAddDiv" style="display: none; overflow: hidden; position:absolute; z-index: 30px; width: 334px; left: 140px; top: 20px; background:#ececec; height: 122px; border: solid #aaa 1px; background-color: #FFFFFF;">
        <div style="padding:10px;">
            <form id="catForm" name="catForm" method="post" action="<?php echo $this->url(array('action' => 'addCategory')); ?>" style="margin:0px;">
                <table width="98%" border="0" align="right" cellpadding="3" cellspacing="0">
                    <tr>
                        <td nowrap="nowrap"><strong>Category Name</strong></td>
                        <td>
                            <input name="CategoryName" type="text" id="CategoryName" size="25" />
                        </td>
                    </tr>
                    <tr>
                        <td nowrap="nowrap"><strong>Description:</strong></td>
                        <td>
                            <input name="CategoryDesc" type="text" id="CategoryDesc" size="25" />
                        </td>
                    </tr>
                    <tr>
                        <td>&nbsp;</td>
                        <td>
                            <input name="add-cat-btn" type="button" class="small" id="add-cat-btn" value="Add Category" />
                            <input name="cancel-cat-btn" type="button" class="small" id="cancel-cat-btn" value="Cancel" />
                        </td>
                    </tr>
                </table>
                <input type="hidden" name="MM_insert2" value="catForm" />
                <input type="hidden" name="MM_insert" value="catForm" />
            </form>
        </div>
    </div>
</div>

<input type="hidden" id="ajax_url" value="<?php echo $this->url('ajax.php'); ?>" />
<input type="hidden" id="events_list_url" value="<?php echo $this->url(array('action' => 'list_events')); ?>" />
<?php echo $this->script('js/events.js'); ?>